home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / include / user / RCS / vmStat.h,v < prev    next >
Encoding:
Text File  |  1992-07-17  |  15.5 KB  |  525 lines

  1. head     1.11;
  2. branch   ;
  3. access   ;
  4. symbols  srv030:1.11 srv027:1.11 srv026:1.11 srv024:1.10 srv021:1.9 srv019:1.8 srv018:1.7 srv016:1.7 srv014:1.7 srv010:1.7 srv008:1.7 srv007:1.6 srv006:1.6 srv005:1.6 srv004:1.6 srv003:1.5 srv002:1.4 srv001:1.3;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.11
  10. date     92.07.09.15.43.33;  author kupfer;  state Exp;
  11. branches ;
  12. next     1.10;
  13.  
  14. 1.10
  15. date     92.07.08.12.45.27;  author kupfer;  state Exp;
  16. branches ;
  17. next     1.9;
  18.  
  19. 1.9
  20. date     92.07.02.16.45.23;  author kupfer;  state Exp;
  21. branches ;
  22. next     1.8;
  23.  
  24. 1.8
  25. date     92.06.29.16.07.32;  author kupfer;  state Exp;
  26. branches ;
  27. next     1.7;
  28.  
  29. 1.7
  30. date     92.06.02.14.57.43;  author kupfer;  state Exp;
  31. branches ;
  32. next     1.6;
  33.  
  34. 1.6
  35. date     92.05.07.23.03.48;  author kupfer;  state Exp;
  36. branches ;
  37. next     1.5;
  38.  
  39. 1.5
  40. date     92.04.29.21.23.21;  author kupfer;  state Exp;
  41. branches ;
  42. next     1.4;
  43.  
  44. 1.4
  45. date     92.04.23.23.55.34;  author kupfer;  state Exp;
  46. branches ;
  47. next     1.3;
  48.  
  49. 1.3
  50. date     92.04.16.11.13.18;  author kupfer;  state Exp;
  51. branches ;
  52. next     1.2;
  53.  
  54. 1.2
  55. date     92.02.28.19.55.14;  author kupfer;  state Exp;
  56. branches ;
  57. next     1.1;
  58.  
  59. 1.1
  60. date     92.02.13.19.12.26;  author kupfer;  state Exp;
  61. branches ;
  62. next     ;
  63.  
  64.  
  65. desc
  66. @@
  67.  
  68.  
  69. 1.11
  70. log
  71. @Add swapPagesWasted field.
  72. @
  73. text
  74. @/*
  75.  * vmStat.h --
  76.  *
  77.  *    The statistics structure for the vm module.
  78.  *
  79.  * Copyright (C) 1986, 1992 Regents of the University of California
  80.  * All rights reserved.
  81.  *
  82.  *
  83.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/vmStat.h,v 1.10 92/07/08 12:45:27 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  84.  */
  85.  
  86. #ifndef _VMSTAT
  87. #define _VMSTAT
  88.  
  89. #include <spriteTime.h>
  90. #ifdef SPRITED
  91. #include <vmTypes.h>
  92. #else
  93. #include <sprited/vmTypes.h>
  94. #endif
  95.  
  96. /*
  97.  * Virtual memory statistics structure.
  98.  */
  99.  
  100. typedef struct {
  101.     /* 
  102.      * Misc. stats.
  103.      */
  104.     int syncCalls;        /* number of calls to Vm_SyncAll */
  105.     int    numPhysPages;        /* number of pages in memory */
  106.  
  107.     /* 
  108.      * External pager stats.
  109.      */
  110.     /* data_request */
  111.     int pagesRead[VM_NUM_SEGMENT_TYPES]; /* pages gotten 100% from FS */
  112.     int partialPagesRead[VM_NUM_SEGMENT_TYPES];    /* pages partially from FS */
  113.     int pagesZeroed[VM_NUM_SEGMENT_TYPES]; /* pages completely zero-filled */
  114.     Time readTime[VM_NUM_SEGMENT_TYPES]; /* time spent in data_request */
  115.     Time readCopyTime[VM_NUM_SEGMENT_TYPES]; /* data_request time for 
  116.                           * segment copy */ 
  117.     /* data_return */
  118.     int returnCalls;        /* calls to data_return */
  119.     int pagesWritten[VM_NUM_SEGMENT_TYPES]; /* pages written */
  120.     int pagesCleaned[VM_NUM_SEGMENT_TYPES]; /* pages written because of 
  121.                          * Sprite cleaning request */
  122.     Time writeTime[VM_NUM_SEGMENT_TYPES]; /* time spent in data_return */
  123.     /* memory_object_init */
  124.     int initCalls;        /* calls to memory_object_init */
  125.     int forcedInits;        /* number of times segment init was forced 
  126.                  * by VmAddrRegion */
  127.     Time initTime;        /* time spent in memory_object_init */
  128.     /* memory_object_terminate */
  129.     int terminateCalls;        /* calls to memory_object_terminate */
  130.     Time terminateTime;        /* time spent in memory_object_terminate */
  131.     /* memory_object_data_unlock */
  132.     int unlockCalls;        /* calls to memory_object_data_unlock */
  133.     /* memory_object_lock_completed */
  134.     int lockCompletedCalls;    /* calls to memory_object_lock_completed */
  135.     Time lockCompletedTime;    /* time spent in lock_completed */
  136.  
  137.     /* 
  138.      * segment stats.
  139.      */
  140.     int segmentsCreated;
  141.     int segmentsDestroyed;
  142.     int segmentsNeedlesslyDestroyed;
  143.                 /* swap segments that could have been 
  144.                  * trivially reused */
  145.     int swapPagesWasted;    /* number of pages that had to be faulted 
  146.                  * in again because the heap/stack segment 
  147.                  * was destroyed at exec */
  148.     int queueOverflows;        /* num times segment had to be removed from 
  149.                  * request port set because it was getting
  150.                  * swamped by requests */
  151.     int segmentLookups;        /* num times segment was sought in main list */
  152.     int segmentsLookedAt;    /* num of segments that had to be looked at 
  153.                  * when doing lookups */ 
  154.  
  155.     /* 
  156.      * Debugging stats; liable to change.
  157.      */
  158.  
  159.     /* Stats for segment copies. */
  160.     int segmentCopies;        /* number of copies */
  161.     Time forkTime;        /* total time spent in Vm_Fork */
  162.     Time findRegionTime;    /* Vm_Fork time in vm_region */
  163.     Time segLookupTime;        /* Vm_Fork time in VmSegByName */
  164.     Time segCopyTime;        /* Vm_Fork time in VmSegmentCopy */
  165.     Time regionCopyTime;    /* Vm_Fork time in CopyRegion */
  166.     int sourceCopyRead;        /* source pages read from swap while 
  167.                  * copying segment */ 
  168.     int sourceCopyZeroed;    /* source pages zero-filled */
  169.     int targetCopyRead;        /* target pages read from swap during 
  170.                  * copy, only to be overwritten */
  171.     int targetCopyZeroed;    /* target pages zero-filled before being 
  172.                  * overwritten  */
  173.     int pagesCopied;        /* sum of page sizes copied */
  174.     int swapPagesCopied;    /* sum of page sizes of segment backing 
  175.                  * files  */
  176.     int objPagesCopied;        /* sum of page sizes of heap "init" files */
  177. } Vm_Stat;
  178.  
  179. #ifdef SPRITED
  180. extern    Vm_Stat    vmStat;
  181. #endif
  182.  
  183. #endif /* _VMSTAT */
  184. @
  185.  
  186.  
  187. 1.10
  188. log
  189. @Change read/write counts and times to be per segment type.  Add
  190. segmentsNeedlesslyDestroyed count.
  191. @
  192. text
  193. @d10 1
  194. a10 1
  195.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/vmStat.h,v 1.9 92/07/02 16:45:23 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  196. d70 5
  197. a74 1
  198.                 /* swap segments that could have been reused */
  199. @
  200.  
  201.  
  202. 1.9
  203. log
  204. @Add forcedInits field.
  205. @
  206. text
  207. @d10 1
  208. a10 1
  209.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/vmStat.h,v 1.8 92/06/29 16:07:32 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  210. d17 5
  211. d37 14
  212. a50 6
  213.     int pagesRead;        /* data_request pages gotten 100% from FS */
  214.     int partialPagesRead;    /* data_request pages partially from FS */
  215.     int pagesZeroed;        /* data_request pages that were zero-filled */
  216.     int pagesWritten;        /* data_write pages */
  217.     int pagesCleaned;        /* data_write pages caused by Sprite 
  218.                  * cleaning request */
  219. d54 2
  220. d57 2
  221. a58 1
  222.     int returnCalls;        /* calls to data_return */
  223. d60 1
  224. a61 6
  225.  
  226.     Time readTime;        /* time spent in data_request */
  227.     Time readCopyTime;        /* data_request time for segment copy */
  228.     Time writeTime;        /* time spent in data_return */
  229.     Time initTime;        /* time spent in memory_object_init */
  230.     Time terminateTime;        /* time spent in memory_object_terminate */
  231. d69 2
  232. @
  233.  
  234.  
  235. 1.8
  236. log
  237. @Instrument all of the pager calls.  More instrumentation for Vm_Fork.
  238. @
  239. text
  240. @d10 1
  241. a10 1
  242.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/vmStat.h,v 1.7 92/06/02 14:57:43 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  243. d39 2
  244. @
  245.  
  246.  
  247. 1.7
  248. log
  249. @Add readTime & writeTime.
  250. @
  251. text
  252. @d10 1
  253. a10 1
  254.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/vmStat.h,v 1.6 92/05/07 23:03:48 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  255. d38 6
  256. d45 5
  257. a49 1
  258.     Time writeTime;        /* time spent in data_write */
  259. d70 4
  260. @
  261.  
  262.  
  263. 1.6
  264. log
  265. @Change "copy" stats, now that segment copies are done using vm_read &
  266. vm_write, rather than the memory_object interface.
  267. @
  268. text
  269. @d10 1
  270. a10 1
  271.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/vmStat.h,v 1.5 92/04/29 21:23:21 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  272. d36 4
  273. a39 1
  274.     int pagesCleaned;        /* data_write pages from cleaning a segment */
  275. @
  276.  
  277.  
  278. 1.5
  279. log
  280. @Add counters for the sizes of segments that get copied.
  281. @
  282. text
  283. @d6 1
  284. a6 1
  285.  * Copyright (C) 1986 Regents of the University of California
  286. d10 1
  287. a10 1
  288.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/vmStat.h,v 1.4 92/04/23 23:55:34 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  289. d54 1
  290. a54 1
  291.     /* Stats for successful segment copies. */
  292. d56 10
  293. a65 11
  294.     Time segmentCopyTime;    /* total time spent doing copies */
  295.     Time cleanTime;        /* time spent cleaning segment before 
  296.                  * copying swap file */
  297.     Time writeBackTime;        /* cleaning time spent actually writing to 
  298.                  * server */
  299.     Time fileCopyTime;        /* time spent copying the swap file */
  300.     Time getSegTime;        /* time to alloc segment & lock original */
  301.     Time unprotSegTime;        /* time to unprotect original after making 
  302.                  * copy */ 
  303.     int pagesCopied;        /* sum of page sizes of segments copied */
  304.     int realPagesCopied;    /* sum of page sizes of segment backing 
  305. d67 1
  306. @
  307.  
  308.  
  309. 1.4
  310. log
  311. @Add more detailed instrumentation for copying segments.
  312. @
  313. text
  314. @d10 1
  315. a10 1
  316.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/vmStat.h,v 1.3 92/04/16 11:13:18 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  317. d65 3
  318. @
  319.  
  320.  
  321. 1.3
  322. log
  323. @Replace Vm_Stat with sprited-related numbers
  324. @
  325. text
  326. @d10 1
  327. a10 1
  328.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/vmStat.h,v 1.2 92/02/28 19:55:14 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  329. d53 12
  330. a64 2
  331.     int segmentCopies;        /* number of successful segment copies */
  332.     Time copyTime;        /* total time spent doing successful copies */
  333. @
  334.  
  335.  
  336. 1.2
  337. log
  338. @Get working with sprited.
  339. @
  340. text
  341. @d10 1
  342. a10 1
  343.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/vmStat.h,v 1.1 92/02/13 19:12:26 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  344. d16 1
  345. a16 8
  346. #if defined(KERNEL) || defined(SPRITED)
  347. #include <vmMachStat.h>
  348. #else
  349. #include <kernel/vmMachStat.h>
  350. #endif
  351.  
  352.  
  353. /*---------------------------------------------------------------------*/
  354. d23 2
  355. a24 80
  356.     int    numPhysPages;        /* The number of physical pages available. */
  357.     /*
  358.      * Different types of pages
  359.      */
  360.     int    numFreePages;        /* Number of pages on the free list. */
  361.     int    numDirtyPages;        /* Number of pages on the dirty list. */
  362.     int    numReservePages;    /* Number of pages held in reserve for the
  363.                  * kernel. */
  364.     int    numUserPages;        /* Number of pages on the allocate list.  Each
  365.                  * of these pages must be used by user
  366.                  * processes. */
  367.     int    kernStackPages;        /* Number of pages allocated to the kernel.*/
  368.     int kernMemPages;        /* Number of pages allocated to kernel code
  369.                  * + data. */
  370.     /*
  371.      * Page fault statistics.
  372.      */
  373.     int    totalFaults;        /* The total number of page faults that have
  374.                    occured. */
  375.     int    totalUserFaults;    /* The total number of page faults that have
  376.                    occured because of a user bus error. */
  377.     int    zeroFilled;        /* Page faults that were satisfied by zero
  378.                    filling the page. */
  379.     int    fsFilled;        /* Page faults that were satisifed by reading
  380.                    in from the file system. */
  381.     int    psFilled;        /* Page faults that were satisfied by reading
  382.                    in from the page server. */
  383.     int    collFaults;        /* Page faults that collided with another page
  384.                    fault in progress on the same page. */
  385.     int    quickFaults;        /* Page faults that were satisfied by just
  386.                    revalidating the page. */
  387.     int    codeFaults;        /* Code segment faults, ignoring quickFaults.*/
  388.     int    heapFaults;        /* Heap segment faults, ignoring quickFaults.*/
  389.     int    stackFaults;        /* Stack segm't faults, ignoring quickFaults.*/
  390.     /*
  391.      * Page allocation stats.
  392.      */
  393.     int    numAllocs;        /* Total number of page allocations. */
  394.     int    gotFreePage;        /* Number of allocations by using a free page.*/
  395.     int    pageAllocs;        /* Calls to internal page allocator. */
  396.     int    gotPageFromFS;        /* Number of allocations satisfied by 
  397.                  * stealing a page from the file system. */
  398.     int    numListSearches;    /* Number of allocations that actually search
  399.                  * the allocation list. */
  400.     int    usedFreePage;        /* List searches satisfied with free page. */
  401.     int    lockSearched;        /* Number of locked pages encountered 
  402.                  * while searching list. */
  403.     int    refSearched;        /* Number of referenced pages encountered 
  404.                  * while searching list. */
  405.     int    dirtySearched;        /* Number of dirty pages encountered 
  406.                  * while searching list. */
  407.     int    reservePagesUsed;    /* The number of pages held in reserve that */
  408.  
  409.     /*
  410.      * Dirty page statistics.
  411.      */
  412.     int    pagesWritten;        /* The number of pages that were written out
  413.                    to the page server. */
  414.     int    cleanWait;        /* The number of times that a segment being 
  415.                    cleaned has to wait for a page to finish
  416.                    being cleaned. */
  417.     int    pageoutWakeup;        /* The number of times that the pageout daemon
  418.                    wakes up. */
  419.  
  420.     int    pageoutNoWork;        /* The number of times that the pageout daemon
  421.                    woke up and there was nothing to do. */
  422.     int pageoutWait;        /* The number of times that a process has to
  423.                    wait for the pageout daemon to finish 
  424.                    because too many pages were dirty. */
  425.     /*
  426.      * Page mapping statistics.
  427.      */
  428.     int    mapPageWait;        /* The number of times that have to wait 
  429.                    because of run out of entries to map 
  430.                    pages. */
  431.     int    accessWait;        /* The number of times that have to wait
  432.                    because of run out of entries to make
  433.                    pages accessible. */
  434.     /*
  435.      * Machine dependent statistics.
  436. d26 26
  437. a51 4
  438.     VmMachDepStat    machDepStat;
  439.     /*
  440.      * The minimum number of virtual memory pages
  441.      * that the system guarantees itself. 
  442. d53 2
  443. a54 63
  444.     int    minVMPages;
  445.     /*
  446.      * File system mapping stats.
  447.      */
  448.     int    fsAsked;        /* The number of times that the file system
  449.                  * asked us for our reference time. */
  450.     int    haveFreePage;        /* We have a free page when fs asks us for the
  451.                  * reference time. */
  452.     int    fsMap;            /* The number of pages that the file system
  453.                  * got from us. */
  454.     int    fsUnmap;        /* The number of pages that the file system
  455.                  * returned to us. */
  456.     int    maxFSPages;        /* The maximum number of pages given to the
  457.                  * file system. */
  458.     int    minFSPages;        /* The minimum number of pages given to the 
  459.                  * file system. */
  460.     /*
  461.      * Copy-on-write info.
  462.      */
  463.     int    numCOWHeapPages;    /* Heap pages that were made copy-on-write. */
  464.     int    numCOWStkPages;        /* Stack pages that were made copy-on-write. */
  465.     int numCORHeapPages;    /* Heap pages that were made copy-on-ref. */
  466.     int numCORStkPages;        /* Stack pages that were made copy-on-ref. */
  467.     int    numCOWHeapFaults;    /* Heap copy-on-write faults. */
  468.     int    numCOWStkFaults;    /* Stack copy-on-write faults. */
  469.     int    quickCOWFaults;        /* COW faults that were unnecessary. */
  470.     int numCORHeapFaults;    /* Heap copy-on-ref faults. */
  471.     int numCORStkFaults;    /* Stack copy-on-ref faults. */
  472.     int    quickCORFaults;        /* COR faults that were unnecessary. */
  473.     int swapPagesCopied;    /* The number of swap file page copies. */
  474.     int    numCORCOWHeapFaults;    /* Number of copy-on-reference heap pages that
  475.                  * get modified after they are copied. */
  476.     int    numCORCOWStkFaults;    /* Number of copy-on-reference stack pages that
  477.                  * get modified after they are copied. */
  478.     /*
  479.      * Recycled potentially modified page stats.
  480.      */
  481.     int    potModPages;        /* Number of pages that came to the front of
  482.                  * the LRU list, were writeable but were not
  483.                  * modified. */
  484.     int    notModPages;        /* Pages out of potModPages that were never
  485.                  * modified in software or hardware. */
  486.     int    notHardModPages;    /* Pages out of potModPages that were never
  487.                  * modified in hardware. */
  488.     /*
  489.      * Prefetch stats.
  490.      */
  491.     int    codePrefetches;        /* Number of prefetches of code. */
  492.     int    heapSwapPrefetches;    /* Number of prefetches of heap from swap. */
  493.     int    heapFSPrefetches;    /* Number of heap prefetches from the object 
  494.                  * file. */
  495.     int    stackPrefetches;    /* Number of prefetches that hit from the
  496.                  * stack swap file. */
  497.     int    codePrefetchHits;    /* Number of code prefetches that hit. */
  498.     int    heapSwapPrefetchHits;    /* Number of heap prefetches from swap that
  499.                  * hit. */
  500.     int    heapFSPrefetchHits;    /* Number of heap prefetches from the object
  501.                  * file that hit. */
  502.     int    stackPrefetchHits;    /* Number of stack prefetches from swap that
  503.                  * hit. */
  504.     int    prefetchAborts;        /* Number of prefetches aborted because there
  505.                      * is no memory available. */
  506.  
  507. d57 1
  508. d59 2
  509. @
  510.  
  511.  
  512. 1.1
  513. log
  514. @Initial revision
  515. @
  516. text
  517. @d10 1
  518. a10 1
  519.  * $Header: /sprite/src/lib/include/RCS/vmStat.h,v 8.4 91/03/04 16:09:28 kupfer Exp $ SPRITE (Berkeley)
  520. d16 2
  521. a17 2
  522. #ifdef KERNEL
  523. #include "vmMachStat.h"
  524. @
  525.